package com.example.getinfo;

import java.io.StringReader;
import java.net.URL;
import java.util.ArrayList;
import java.util.Dictionary;
import java.util.List;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserFactory;

import com.example.util.TClient;

public class GetDrivinglicenseInfo {
	
	public static List getDrivinglicenseInfo(String str) {
		List<String> lists = new ArrayList<String>();
		String reqStr = "3770003320368";
	    String xmlStr =  TClient.commMethod(str);
	    System.out.println("67676767676767"+xmlStr);
		try {
			XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
			XmlPullParser parser = factory.newPullParser();
			parser.setInput(new StringReader(xmlStr));

			int eventType = parser.getEventType();
			while (eventType != XmlPullParser.END_DOCUMENT) {
				System.out.println("2222222222222");
				if (eventType == XmlPullParser.START_TAG) {
					if ("barcode".equals(parser.getName())) {
						String pageallcount = parser.nextText();
						
						lists.add(pageallcount);
						
					}
					if ("carno".equals(parser.getName())) {
						String businessid = parser.nextText();
						lists.add(businessid);
					}
					if ("cartype".equals(parser.getName())) {
						String title = parser.nextText();
						lists.add(title);
					}
					if ("color".equals(parser.getName())) {
						String time = parser.nextText();
						lists.add(time);
					}
					if ("checkdate".equals(parser.getName())) {
						String time = parser.nextText();
						lists.add(time);
					}
					if ("vin".equals(parser.getName())) {
						String time = parser.nextText();
						lists.add(time);
					}
					if ("driverid".equals(parser.getName())) {
						String time = parser.nextText();
						lists.add(time);
					}
					if ("drivername".equals(parser.getName())) {
						String time = parser.nextText();
						lists.add(time);
					}
					if ("drivergender".equals(parser.getName())) {
						String time = parser.nextText();
						lists.add(time);
					}
					if ("nationality".equals(parser.getName())) {
						String time = parser.nextText();
						lists.add(time);
					}
					if ("address".equals(parser.getName())) {
						String time = parser.nextText();
						lists.add(time);
					}
					if ("birthday".equals(parser.getName())) {
						String time = parser.nextText();
						lists.add(time);
					}
					if ("issuedate".equals(parser.getName())) {
						String time = parser.nextText();
						lists.add(time);
					}
					if ("classtype".equals(parser.getName())) {
						String time = parser.nextText();
						lists.add(time);
					}
					if ("validdate".equals(parser.getName())) {
						String time = parser.nextText();
						lists.add(time);
					}
					if ("validfor".equals(parser.getName())) {
						String time = parser.nextText();
						lists.add(time);
					}
					if ("filenumber".equals(parser.getName())) {
						String time = parser.nextText();
						lists.add(time);
					}
					if ("score".equals(parser.getName())) {
						String time = parser.nextText();
						lists.add(time);
					}
					if ("money".equals(parser.getName())) {
						String time = parser.nextText();
						lists.add(time);
					}
				}
				eventType = parser.next();
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return lists;
	}
	 
}
